package pl.edu.agh.soa.monitoring.xbean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.servicemix.common.DefaultComponent;
import org.apache.servicemix.common.xbean.BaseXBeanDeployer;
import org.apache.servicemix.common.xbean.ParentBeanFactoryPostProcessor;

import pl.edu.agh.soa.monitoring.endpoints.MonitoringEndpoint;

public class EsperXBeanDeployer extends BaseXBeanDeployer {

    public EsperXBeanDeployer(DefaultComponent component) {
        super(component, MonitoringEndpoint.class);
    }

    protected List getBeanFactoryPostProcessors(String serviceUnitRootPath) {
        Map beans = new HashMap();
        beans.put("context", component.getComponentContext());
        List processors = new ArrayList(super.getBeanFactoryPostProcessors(serviceUnitRootPath));
        processors.add(new ParentBeanFactoryPostProcessor(beans));
        return processors;
    }
}
